const { contextBridge, ipcRenderer } = require("electron");

contextBridge.exposeInMainWorld("versions", {
  node: () => process.versions.node,
  chrome: () => process.versions.chrome,
  electron: () => process.versions.electron,
});
contextBridge.exposeInMainWorld("updateApp", {
  send: (title) => {
    return ipcRenderer.send("send", title);
  },
});

contextBridge.exposeInMainWorld("system", {
  onUpdateData: (callback) =>
    ipcRenderer.on("update-counter", (_event, value) => callback(value)),
});
